package com.dy.design_pattern_study.chain_of_responsibility_pattern.dome2;

import lombok.Getter;
import lombok.Setter;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-22
 * @Content 处理请示的接口
 */
public abstract class Handler {
    //继任者
    @Setter
    protected Handler successor;

    @Setter
    @Getter
    protected String name;

    //处理请求的抽象方法
    public abstract void handleRequest(int request);

    protected String printTemplate(int request){
        String message = getName() + " : 处理请求 " + request;
        return message;
    }
}
